package com.example.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.web.entity.User;
import com.example.web.mapper.UserMapper;
import com.example.web.service.UserService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class UserServiceImpl implements UserService{

	@Autowired
	UserMapper userMapper;
	
	@Override
	public Object getList1(int pageNum, int pageSize) {
		PageHelper.offsetPage(pageNum, pageSize);
		List<User> list = userMapper.getList();
		PageInfo<User> appsPageInfo = new PageInfo<>(list);	
		return appsPageInfo;
	}

	@Override
	public Page<User> getList2(int pageNum, int pageSize) {
		PageHelper.offsetPage(pageNum, pageSize);
		Page<User> list = (Page<User>) userMapper.getList();
		return list;
	}


	
}
